<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>MISSJ网站管理</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="public/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="public/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <script src="public/js/echarts.min.js"></script>
    <link rel="stylesheet" href="public/css/amazeui.min.css" />
    <link rel="stylesheet" href="public/css/amazeui.datatables.min.css" />
    <link rel="stylesheet" href="public/css/app.css">
    <script src="public/js/jquery.min.js"></script>

</head>
<body data-type="index">
<script src="public/js/theme.js"></script>
<div class="am-g tpl-g">
    <!-- 头部 -->
    <header>
        <!-- logo -->
        <div class="am-fl tpl-header-logo">
            <a href="admin.php"><img src="public/img/logo.png" alt=""></a>
        </div>
        <!-- 右侧内容 -->
        <div class="tpl-header-fluid">
            <!-- 侧边切换 -->
            <div class="am-fl tpl-header-switch-button am-icon-list">
                    <span>

                </span>
            </div>
            <!-- 搜索 -->
            <div class="am-fl tpl-header-search">

            </div>
            <!-- 其它功能-->
            <div class="am-fr tpl-header-navbar">
                <ul>
                    <!-- 欢迎语 -->
                    <li class="am-text-sm tpl-header-navbar-welcome">
                        <a href="javascript:;">欢迎你, <span><?php echo ($_SESSION['adminUser']['username']); ?></span> </a>
                    </li>

                    <!-- 退出 -->
                    <li class="am-text-sm">
                        <a href="admin.php?c=login&a=loginout">
                            <span class="am-icon-sign-out"></span> 退出
                        </a>
                    </li>
                </ul>
            </div>
        </div>

    </header>
    <!-- 风格切换 -->
    <div class="tpl-skiner">
        <div class="tpl-skiner-toggle am-icon-cog">
        </div>
        <div class="tpl-skiner-content">
            <div class="tpl-skiner-content-title">
                选择主题
            </div>
            <div class="tpl-skiner-content-bar">
                <span class="skiner-color skiner-white" data-color="theme-white"></span>
                <span class="skiner-color skiner-black" data-color="theme-black"></span>
            </div>
        </div>
    </div>
<!-- 侧边导航栏 -->
<div class="left-sidebar">
  <!-- 用户信息 -->
  <div class="tpl-sidebar-user-panel">
    <div class="tpl-user-panel-slide-toggleable">
      <div class="tpl-user-panel-profile-picture">
        <img src="<?php echo ($_SESSION['adminUser']['thumb']); ?>" width="82" height="82" alt="<?php echo ($_SESSION['adminUser']['username']); ?>">
      </div>
                    <span class="user-panel-logged-in-text">
              <i class="am-icon-circle-o am-text-success tpl-user-panel-status-icon"></i>
                      <?php echo ($_SESSION['adminUser']['username']); ?>
          </span>
      <a href="admin.php?c=admin&a=edit&id=<?php echo ($_SESSION['adminUser']['id']); ?>" class="tpl-user-panel-action-link"> <span class="am-icon-pencil"></span> 账号设置</a>
    </div>
  </div>

  <!-- 菜单 -->
  <ul class="sidebar-nav">
    <li class="sidebar-nav-link">
      <a href="admin.php" <?php if($model == Index): ?>class="active"<?php endif; ?>>
      <i class="am-icon-home sidebar-nav-link-logo"></i> 首页
      </a>
    </li>
    <li class="sidebar-nav-link">
      <a href="admin.php?c=category" <?php if($model == Category): ?>class="active"<?php endif; ?>>
      <i class="am-icon-tags sidebar-nav-link-logo"></i> 分类管理
      </a>
    </li>
    <li class="sidebar-nav-link">
      <a href="admin.php?c=product" <?php if($models == Product): ?>class="active"<?php endif; ?>>
      <i class="am-icon-inbox sidebar-nav-link-logo"></i> 产品管理
      </a>
    </li>
    <li class="sidebar-nav-link">
      <a href="admin.php?c=admin" <?php if($model == Admin): ?>class="active"<?php endif; ?>>
        <i class="am-icon-user sidebar-nav-link-logo"></i> 用户管理
      </a>
    </li>
    <li class="sidebar-nav-link">
      <a href="admin.php?c=about" <?php if($model == About): ?>class="active"<?php endif; ?>>
      <i class="am-icon-info sidebar-nav-link-logo"></i> 关于我们
      </a>
    </li>
    <li class="sidebar-nav-link">
      <a href="admin.php?c=setting" <?php if($model == Setting): ?>class="active"<?php endif; ?>>
      <i class="am-icon-gear sidebar-nav-link-logo"></i> 网站设置
      </a>
    </li>
  </ul>
</div>
<!-- 内容区域 -->
<script src="Public/js/kindeditor/kindeditor-all.js"></script>
<div class="tpl-content-wrapper">
    <div class="row-content am-cf">
        <div class="row">

            <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                <div class="widget am-cf">
                    <div class="widget-head am-cf">
                        <div class="widget-title am-fl">添加产品</div>
                        <div class="widget-function am-fr">
                            <a href="javascript:;" class="am-icon-cog"></a>
                        </div>
                    </div>
                    <div class="widget-body am-fr">

                        <form class="am-form tpl-form-border-form tpl-form-border-br" id="missj-form">
                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">编辑名称</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" value="<?php echo ($pro["pname"]); ?>" name="pname" placeholder="请输入产品名称">
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">货号</label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" value="<?php echo ($pro["code"]); ?>" name="code" placeholder="请输入货号">
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-weibo" class="am-u-sm-3 am-form-label">缩略图</label>
                                <div class="am-u-sm-9">
                                    <div class="am-form-group am-form-file">
                                        <div class="tpl-form-file-img">
                                            <img id="upload_org_code_img" src="<?php echo ($pro["thumb"]); ?>" alt="" width="150"  height="150">
                                        </div>
                                        <input id="file_upload"  type="file" multiple="true" >
                                        <input id="file_upload_image" name="thumb" type="hidden" multiple="true" value="<?php echo ($pro["thumb"]); ?>">
                                    </div>

                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label">产品分类</label>
                                <div class="am-u-sm-9">
                                    <select data-am-selected="{btnSize: 'sm'}" name="catid">
                                        <?php if(is_array($cate)): $i = 0; $__LIST__ = $cate;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$cate): $mod = ($i % 2 );++$i;?><option value="<?php echo ($cate["id"]); ?>" <?php if($pro['catid'] == $cate['id']): ?>selected="selected"<?php endif; ?>><?php echo ($cate["catname"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                    </select>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label">发丝材质</label>
                                <div class="am-u-sm-9">
                                    <select data-am-selected="{btnSize: 'sm'}" name="material">
                                        <?php if(is_array($material)): foreach($material as $key=>$material): ?><option value="<?php echo ($key); ?>" <?php if($key == $pro['material']): ?>selected="selected"<?php endif; ?>><?php echo ($material); ?></option><?php endforeach; endif; ?>
                                    </select>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-phone" class="am-u-sm-3 am-form-label">制作工艺</label>
                                <div class="am-u-sm-9">
                                    <select data-am-selected="{btnSize: 'sm'}" name="tech">
                                        <?php if(is_array($tech)): foreach($tech as $key=>$tech): ?><option value="<?php echo ($key); ?>" <?php if($key == $pro['tech']): ?>selected="selected"<?php endif; ?>><?php echo ($tech); ?></option><?php endforeach; endif; ?>
                                    </select>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label for="user-phone" class="am-u-sm-3 am-form-label">发型</label>
                                <div class="am-u-sm-9">
                                    <select data-am-selected="{btnSize: 'sm'}" name="model">
                                        <?php if(is_array($model)): foreach($model as $key=>$model): ?><option value="<?php echo ($key); ?>" <?php if($key == $pro['model']): ?>selected="selected"<?php endif; ?>><?php echo ($model); ?></option><?php endforeach; endif; ?>
                                    </select>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label">编码</label>
                                <div class="am-u-sm-9">
                                    <input type="text" placeholder="编码" name="ean" value="<?php echo ($pro["ean"]); ?>">
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label">购买地址</label>
                                <div class="am-u-sm-9">
                                    <input type="text" placeholder="购买地址" name="buyurl" value="<?php echo ($pro["buyurl"]); ?>">
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label for="user-intro" class="am-u-sm-3 am-form-label">产品详情</label>
                                <div class="am-u-sm-9">
                                    <textarea class="input js-editor" id="editor_missj" name="content" rows="20" placeholder="请输入产品详细介绍"><?php echo ($pro["content"]); ?></textarea>
                                </div>
                            </div>
                            <input type="hidden" name="id" value="<?php echo ($pro['id']); ?>"/>
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3">
                                    <button type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success" id="missj-button-submit">提交</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</div>
<script>
    var SCOPE = {
        'save_url' : 'admin.php?c=Product&a=add',
        'jump_url' : 'admin.php?c=Product',
        'ajax_upload_image_url' : 'admin.php?c=image&a=ajaxuploadimage',
        'ajax_upload_swf' : 'Public/js/party/uploadify.swf',
    };
</script>
<script src="Public/js/admin/image.js"></script>
<script>
    // 6.2
    KindEditor.ready(function(K) {
        window.editor = K.create('#editor_missj',{
            uploadJson : 'admin.php?c=image&a=kindupload',
            afterBlur : function(){this.sync();}, //
        });
    });
</script>
<script src="public/js/amazeui.min.js"></script>
<script src="public/js/amazeui.datatables.min.js"></script>
<script src="public/js/dataTables.responsive.min.js"></script>
<script src="public/js/app.js"></script>

<script src="Public/js/dialog/layer.js"></script>
<script src="Public/js/dialog.js"></script>
<script src="Public/js/party/jquery.uploadify.js"></script>
<script src="Public/js/admin/common.js"></script>
<div id="tpl-echarts"></div>
</body>

</html>